home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / tls / tls085.solintel.Z / tls085.solintel / lib / vtcl / tests / dlist.tcl < prev    next >
Encoding:
Text File  |  1995-07-20  |  16.4 KB  |  671 lines

  1. # CVS $Id: dlist.tcl,v 1.3 1995/02/03 16:54:33 zibi Exp $
  2. source tools.tcl
  3.  
  4. global DefaultList
  5.  
  6. #
  7. # On error, just display, if no error then
  8. # exit and yell.
  9. #
  10. proc doTestError {cmd lst args} {
  11.     set args [join $args]
  12.          Display 1 "Error Test <$cmd $args>"
  13.  
  14.     catch {
  15.         eval "$cmd $lst $args"
  16.     } msg
  17.  
  18.     if {$msg == ""} {
  19.            error "No error was detected <$cmd $args>"
  20.     }
  21.  
  22.     Display 1 "Passed Error Test <$cmd $args>\n$msg"
  23. }
  24.  
  25. #
  26. # Restores a list back to a know state
  27. #
  28. proc restoreList {dl} {
  29.      global DefaultList
  30.  
  31.      lappend rl { 0         "" ""         "String one"   "Apple"    1}
  32.      lappend rl { CONNECT_T  1 ""      "String two"     "Banna"    2}
  33.      lappend rl { CONNECT_T  2 ""      "String three" "Coconut"  3}
  34.      lappend rl { CONNECT_T  0 ""      "String four"     "Dogs"        4}
  35.      lappend rl { CONNECT_I  CONNECT_L 0  "String five"     "Elephant" 5}
  36.      lappend rl { CONNECT_L  0 ""      "String six"     "Frog"        6}
  37.  
  38.      set DefaultList $rl
  39.  
  40.      VtDrawnListDeleteItem $dl -all
  41.  
  42.      VtDrawnListAddItem $dl -recordList $rl -position 0
  43. }
  44.  
  45. #
  46. # Returns success if list all the items in list a and b are 
  47. #                 equal.
  48. # Returns fail if they aren't
  49. #
  50. proc checkRecord {a b} {
  51.          set i [llength $a]
  52.     set j [llength $b]
  53.  
  54.     if {$i != $j} {
  55.        echo "<$a><$b>"
  56.        echo $i $j
  57.        sleep 4
  58.            error "Records don't match in size"
  59.     }
  60.  
  61.     for {set k 0} {$k < $i} {incr k} {
  62.         set f1 [lindex $a $k]
  63.         set f2 [lindex $b $k]
  64.         if {$f1 != $f2} {
  65.        echo "<$a><$b>"
  66.        sleep 4
  67.             echo $f1 "==" $f2
  68.                return fail
  69.         }
  70.     }
  71.     return pass
  72. }                
  73.  
  74. #
  75. # Checks that the list passed in recList match the positions in 
  76. # the global list DefaultList. If the list don't match this
  77. # routine will call error, which will exit the script.
  78. # The string parameter is the string to spit out on error conditions.
  79. #
  80. # Example
  81. #     checkRecords $selectedList {1 2 3} "VtDrawnListGetSelected"
  82. #
  83. proc checkRecords {recList posList str} {
  84.     global DefaultList
  85.  
  86.     if {[llength $recList] != [llength $posList]} {
  87.            error "recList and posList don't match <$str> \n $recList\n $posList "
  88.     }
  89.  
  90.     set i 0
  91.          foreach r1 $recList {
  92.         set p [lindex $posList $i]
  93.         # posList is 1 based 
  94.         incr p -1
  95.         set r2 [lindex $DefaultList $p]
  96.         set ret [checkRecord $r1 $r2]
  97.         if {$ret == "fail"} {
  98.             error "records dont match <$str> \n  $r1\n  $r2"
  99.         }
  100.         incr i
  101.     }
  102.  
  103.     return pass
  104. }
  105.  
  106. #
  107. # Callback to handle record selection.
  108. # It displays the contents of the selected record in the display
  109. # area.
  110. #
  111. proc recordSelectCB {cbs} {
  112.     set itemPos [keylget cbs itemPosition]
  113.  
  114.     set retTxt "Single Click\nPosition is $itemPos"
  115.     
  116.     set dl [keylget cbs widget]
  117.     set stuff [VtDrawnListGetItem $dl -position $itemPos]
  118.  
  119.     set retTxt "$retTxt\nList contains .. \n  "
  120.     foreach item $stuff {
  121.         set retTxt "$retTxt <$item>"
  122.     }
  123.  
  124.     Display 1 $retTxt
  125. }
  126.  
  127. #
  128. # Just display the item you double clicked on
  129. #
  130. proc doubleCB {cbs} {
  131.     set itemPos [keylget cbs itemPosition]
  132.  
  133.     set retTxt "Double Click\nPosition is $itemPos"
  134.     
  135.     set dl [keylget cbs widget]
  136.     set stuff [VtDrawnListGetItem $dl -position $itemPos]
  137.  
  138.     set retTxt "$retTxt\nList contains .. \n  "
  139.     foreach item $stuff {
  140.         set retTxt "$retTxt <$item>"
  141.     }
  142.  
  143.     Display 1 $retTxt
  144. }
  145.  
  146.  
  147. #
  148. # This is a visual test of adding elements with
  149. # a different formatting string
  150. #
  151. proc testAddCB {lst cbs} {
  152.          global oldLabel
  153.  
  154.     if {[info exists oldLabel] == 0} {
  155.         set oldLabel ""
  156.     }
  157.  
  158.     if {$oldLabel == ""} {
  159.         VtSetValues [keylget cbs widget] -label "Test Add Lots"
  160.     } else {
  161.         VtSetValues [keylget cbs widget] -label $oldLabel
  162.     }
  163.  
  164.  
  165.         VtDrawnListDeleteItem $lst -all
  166.  
  167.     if {$oldLabel == ""} {
  168.              VtDrawnListAddItem $lst \
  169.         -formatList {{ICON 5} {STRING 20 5}}\
  170.         -CHARM_formatList {{ICON 5} {STRING 20 1}}\
  171.         -fieldList {"CONNECT_I NO_ICON 1 CONNECT_H  2" 
  172.                 "Multiple icons" }
  173.  
  174.              VtDrawnListAddItem $lst \
  175.         -formatList {{ICON 1} {STRING 20 5}}\
  176.         -CHARM_formatList {{ICON 1} {STRING 20 1}}\
  177.         -fieldList { 0 "One Icon" }
  178.  
  179.              VtDrawnListAddItem $lst \
  180.         -formatList {{ICON 1} {ICON 1} {STRING 20 5}}\
  181.         -CHARM_formatList {{ICON 1} {ICON 1} {STRING 20 1}}\
  182.         -fieldList { 0 0 "Two Icons" }
  183.  
  184.              VtDrawnListAddItem $lst \
  185.         -formatList {{STRING 20 5} {ICON 1}}\
  186.         -CHARM_formatList {{STRING 20 0} {ICON 1}}\
  187.         -fieldList { "One Icon on End" 0 }
  188.  
  189.              VtDrawnListAddItem $lst \
  190.         -formatList {{ICON 1} {STRING 20 5 5} {ICON 1}}\
  191.         -CHARM_formatList {{ICON 1} {STRING 20 1 1} {ICON 1}}\
  192.         -fieldList { 0 "Icon Sandwich" 0 }
  193.  
  194.              VtDrawnListAddItem $lst \
  195.         -formatList {{STRING 20 0 5} {ICON 1} {STRING 20 5}}\
  196.         -CHARM_formatList {{STRING 20 0 1} {ICON 1} {STRING 20 1}}\
  197.         -fieldList {"Sandwiched Icon" 0 "Sandwiched Icon" }
  198.  
  199.         # multiple icons in a field 
  200.              VtDrawnListAddItem $lst \
  201.         -formatList {{ICON 5} {STRING 20 5}}\
  202.         -CHARM_formatList {{ICON 5} {STRING 20 1}}\
  203.         -fieldList {"CONNECT_I 0 CONNECT_L 1 2" "Multiple icons" }
  204.  
  205.         # multiple icons with one null icon
  206.              VtDrawnListAddItem $lst \
  207.         -formatList {{ICON 5} {STRING 20 5}}\
  208.         -CHARM_formatList {{ICON 5} {STRING 20 1}}\
  209.         -fieldList {"CONNECT_I NO_ICON 1 CONNECT_H  2" 
  210.                 "Multiple icons" }
  211.     } else {
  212.         set recordList ""
  213.         Display 0 "Making List (Speed is not my fault)..."
  214.         VtSetValues $lst -labelFormatList {{STRING 30 5 5} {ICON 3}}
  215.         VtSetValues $lst -labelList {"Left of label" "Icons"}
  216.         for {set i 0} {$i < 600} {incr i} {
  217.             set recordList [lappend recordList \
  218.                     [list $i "Bunches of right icons ($i)" 0 0] ]
  219.         }
  220.         Display 0 "Done making list.\nAbout to Send the command"
  221.              VtDrawnListAddItem $lst \
  222.         -formatList {{DATA} {STRING 30 5 5} {ICON 1} {ICON 1}}\
  223.         -CHARM_formatList {{DATA} {STRING 50 0 1} {ICON 1} {ICON 1}}\
  224.         -recordList $recordList
  225.         Display 0 "Done sending command (fast huh?)"
  226.     }
  227.  
  228.     if {$oldLabel == ""} {
  229.         set oldLabel "Test Add"
  230.     } else {
  231.         set oldLabel ""
  232.     }
  233. }
  234.  
  235. #
  236. # This test setting of the topItemPosition
  237. #
  238. proc testTopItemCB {lst cbs} {
  239.     global DefaultList
  240.  
  241.            restoreList $lst
  242.  
  243.         set rows [llength $DefaultList]
  244.  
  245.     for {set i 1} { $i <= $rows } {incr i} {
  246.         VtSetValues $lst -topItemPosition $i
  247.         set ret [VtGetValues $lst -topItemPosition]
  248.         Display 1 "Setting top to $i"
  249.         if { $i != $ret } {
  250.         error "Top Item Broken i is $i ret is $ret"
  251.         }
  252.     }
  253.     
  254.     sleep 1
  255.  
  256.     for {incr i -1} { $i > 0 } {incr i -1} {
  257.         Display 1 "Setting top to $i"
  258.         VtSetValues $lst -topItemPosition $i
  259.     }
  260.  
  261.     Display 0 "Done, Testing topItemPosition"
  262. }
  263.  
  264. #
  265. # This tests the VtDrawnListSetItem call.
  266. # It excercises the following options
  267. #        -position
  268. #    -field
  269. #    -formatList
  270. #    -fieldList
  271. #
  272. proc doSetItem {lst pos rec args} {
  273.  
  274.     set args [join $args]
  275.  
  276.          Display 1 "Set Test\n   $args"
  277.     eval "VtDrawnListSetItem $lst $args"
  278.     set recordList [VtDrawnListGetItem $lst -position $pos]
  279.     set record [lindex $recordList 0]
  280.  
  281.     set ret [checkRecord $record $rec]
  282.     if {$ret == "fail"} {
  283.            error "Records don't match <$args>"
  284.     }
  285.     Display 1 "Set Test \nPassed $args"
  286. }
  287.  
  288. proc testSetCB {lst cbs} {
  289.  
  290.  
  291.  
  292.     set rec {0 0 0 {New String} "data"}
  293.  
  294.          restoreList $lst
  295.     doSetItem $lst 1 $rec "-position 1 -fieldList {$rec}"
  296.     doSetItem $lst 2 $rec "-position 2 -fieldList {$rec}"
  297.     doSetItem $lst 6 $rec "-position 0 -fieldList {$rec}"
  298.  
  299.     restoreList $lst
  300.     doSetItem $lst 1 $rec "-field 3 {String one} -fieldList {$rec}"
  301.     doSetItem $lst 4 $rec "-field 3 {String four} -fieldList {$rec}"
  302.     doSetItem $lst 6 $rec "-field 3 {String six} -fieldList {$rec}"
  303.  
  304.     Display 0 "VtDrawnListSetItem test DONE"
  305. }
  306.  
  307. #
  308. # This tests the VtDrawnListDeselectItem call.
  309. # It excercises the following options
  310. #        -position
  311. #    -positionList
  312. #    -field
  313. #    -all
  314. #
  315. # This tests relies on the procedure doDeselect to actual
  316. # select of the items.  
  317. #
  318. proc doDeselect {lst posList args} {
  319.  
  320.     set args [join $args]
  321.          Display 1 "Deselect test \n  $args"
  322.     eval "VtDrawnListDeselectItem $lst $args"
  323.     set recordList [VtDrawnListGetSelectedItem $lst -byRecordList]
  324.     checkRecords $recordList $posList $args
  325.     Display 1 "Deselect test \n  Passed $args"
  326. }
  327.  
  328.  
  329. proc testDeselectCB {lst cbs} {
  330.          restoreList $lst
  331.  
  332.     VtDrawnListSelectItem $lst -all
  333.  
  334.     # -positon 
  335.     doDeselect $lst {1 2 3 4 5} "-position 0"
  336.     doDeselect $lst {2 3 4 5}  "-position 1"
  337.     doDeselect $lst {3 4 5}  "-position 2"
  338.     doDeselect $lst {3 5} "-position 4"
  339.  
  340.     # -positionList 1 3 5
  341.     VtDrawnListSelectItem $lst -all
  342.     doDeselect $lst {2 4 6} "-positionList {1 3 5}"
  343.     doDeselect $lst {} "-positionList {2 4 6}"
  344.  
  345.     # -field 3 String one
  346.     VtDrawnListSelectItem $lst -all
  347.     doDeselect $lst {2 3 4 5 6} "-field 3 {String one}"
  348.     doDeselect $lst {2 4 5 6} "-field 3 {String three}"
  349.     doDeselect $lst {2 4 5}  "-field 3 {String six}"
  350.  
  351.     # -all
  352.     doDeselect $lst {} "-all"
  353.     VtDrawnListSelectItem $lst -all
  354.     doDeselect $lst {} "-all"
  355.  
  356.  
  357.     # Now test deselect of things not selected
  358.     doDeselect $lst {} "-all"
  359.     doDeselect $lst {}  "-position 3"
  360.     doDeselect $lst {}  "-positionList {1 4}"
  361.     doDeselect $lst {}  "-field 3 {String six}"
  362.  
  363.     # Tests for some things selected, some not
  364.     # in this test items 2-5 are selected and we're going to
  365.     # deselect items 1 and 2.
  366.     VtDrawnListSelectItem $lst -all
  367.     VtDrawnListDeselectItem $lst -positionList {1 6}
  368.     doDeselect $lst {3 4 5} "-positionList {1 2}"
  369.  
  370.     # now test error conditions
  371.     doTestError "VtDrawnListDeselectItem"  $lst "-position 9"
  372.     doTestError "VtDrawnListDeselectItem"  $lst "-position -1"
  373.     doTestError "VtDrawnListDeselectItem"  $lst "-field 3 {Meat Loaf}"
  374.     doTestError "VtDrawnListDeselectItem"  $lst "-field 99 {beefhart}"
  375.  
  376.     Display 0 "VtDrawnListDeselectItem test DONE"
  377. }
  378.  
  379. #
  380. # This tests the VtDrawnListSelectItem call.
  381. # It excercises the following options
  382. #        -position
  383. #    -positionList
  384. #    -field
  385. #    -all
  386. #
  387. # This tests relies on the procedure doSelect to actual
  388. # select of the items.  It also relies on doSelectError
  389. # which does testing of error conditions on drawnlist.
  390. #
  391. proc doSelect {lst posList args} {
  392.  
  393.     set args [join $args]
  394.          Display 1 "Selected Test \n  $args"
  395.     eval "VtDrawnListSelectItem $lst $args"
  396. #sleep 4xxx
  397.     set recordList [VtDrawnListGetSelectedItem $lst -byRecordList]
  398.     checkRecords $recordList $posList $args
  399.     Display 1 "Select Test \n  Passed $args"
  400. }
  401.  
  402. proc testSelectCB {lst cbs} {
  403.          restoreList $lst
  404.  
  405.     # -positon 0 1 2 6
  406.     doSelect $lst 6 "-position 0"
  407.     doSelect $lst 1 "-position 1"
  408.     doSelect $lst 2 "-position 2"
  409.     doSelect $lst 6 "-position 6"
  410.  
  411.     # -positionList 1 3 5
  412.     doSelect $lst {1 3 5} "-positionList {1 3 5}"
  413.  
  414.     # -field 3 String one
  415.     doSelect $lst 1 "-field 3 {String one}"
  416.     doSelect $lst 3 "-field 3 {String three}"
  417.     doSelect $lst 6 "-field 3 {String six}"
  418.  
  419.     # -next
  420.     doSelect $lst 1 "-position 1"
  421.     doSelect $lst 2 "-next"
  422.     doSelect $lst 6 "-position 6"
  423.     doSelect $lst 6 "-next"
  424.  
  425.     # -previous
  426.     doSelect $lst 6 "-position 6"
  427.     doSelect $lst 5 "-previous"
  428.     doSelect $lst 1 "-position 1"
  429.     doSelect $lst 1 "-previous"
  430.  
  431.     # -all
  432.     doSelect $lst {1 2 3 4 5 6} "-all"
  433.  
  434.     # now test error conditions
  435.     doTestError VtDrawnListSelectItem $lst "-position 9"
  436.     doTestError VtDrawnListSelectItem $lst "-position -1"
  437.     doTestError VtDrawnListSelectItem $lst "-field 3 {Meat Loaf}"
  438.     doTestError VtDrawnListSelectItem $lst "-field 99 {beefhart}"
  439.     
  440.     Display 0 "VtDrawnListSelectItem test DONE"
  441. }
  442.  
  443. #
  444. # This tests the VtDrawnListGetSelectItem call.
  445. # It excercises the following options
  446. #        -byPositionList
  447. #    -byRecordList
  448. #
  449. #
  450. proc doGetSelect {lst posList args} {
  451.  
  452.     set args [join $args]
  453.          Display 1 "GetSelected Test \n  $args"
  454.     eval "VtDrawnListSelectItem $lst $args"
  455. #sleep 4
  456.     set recordList [VtDrawnListGetSelectedItem $lst -byRecordList]
  457.     checkRecords $recordList $posList $args
  458.     Display 1 "GetSelected Test \n  Passed $args"
  459.  
  460.     set pList [VtDrawnListGetSelectedItem $lst -byPositionList]
  461.     if {[checkRecord $pList $posList] == "fail"} {
  462.         echo "<$pList> <$posList>"
  463.         error "Records don't match <$args>"
  464.     }
  465.     
  466.     Display 1 "GetSelected Test \n  Passed $args"
  467. }
  468.  
  469. proc testGetSelectCB {lst cbs} {
  470.          restoreList $lst
  471.  
  472.     # -positon 0 1 2 6
  473.     doGetSelect $lst 6 "-position 0"
  474.     doGetSelect $lst 1 "-position 1"
  475.     doGetSelect $lst 2 "-position 2"
  476.     doGetSelect $lst 6 "-position 6"
  477.  
  478.     # -positionList 1 3 5
  479.     doGetSelect $lst {1 3 5} "-positionList {1 3 5}"
  480.  
  481.     # -field 3 String one
  482.     doGetSelect $lst 1 "-field 3 {String one}"
  483.     doGetSelect $lst 3 "-field 3 {String three}"
  484.     doGetSelect $lst 6 "-field 3 {String six}"
  485.  
  486.     # -all
  487.     doGetSelect $lst {1 2 3 4 5 6} "-all"
  488.  
  489.     # now test error conditions
  490.     doTestError VtDrawnListGetSelectItem $lst \
  491.         "-byPositionList -byRecordList"
  492.     
  493.     Display 0 "VtDrawnListSelectItem test DONE"
  494. }
  495.  
  496. #
  497. # This tests the VtDrawnListGetItems call.
  498. # It excercises the following options
  499. #        -position
  500. #    -positionList
  501. #    -field
  502. #    -all
  503. #
  504. # This tests relies on the procedure doGet to actual
  505. # get of the items.
  506. #
  507. proc doGet {lst posList args} {
  508.  
  509.     set args [join $args]
  510.          Display 1 "Get Test \n   $args"
  511.     set recordList [eval "VtDrawnListGetItem $lst $args"]
  512.     checkRecords $recordList $posList $args
  513.     Display 1 "Get Test \n   Passed $args"
  514. }
  515.  
  516. proc testGetCB {lst cbs} {
  517.          restoreList $lst
  518.  
  519.     # -positon 5
  520.     doGet $lst 5 "-position 5"
  521.  
  522.     # -position 0
  523.     doGet $lst 6 "-position 0"
  524.  
  525.     # check that -positionList works    
  526.     doGet $lst {1 3} "-positionList {1 3}"
  527.  
  528.     # check that field works
  529.     doGet $lst 3 "-field 3 {String three}"
  530.  
  531.     # 
  532.     doTestError VtDrawnListGetItem $lst "-position 33"
  533.     doTestError VtDrawnListGetItem $lst "-field 3 {beefhart}"
  534.     doTestError VtDrawnListGetItem $lst "-position 2 -field 3 {String two}"
  535.  
  536.  
  537.  
  538.     # check that -all work
  539.     doGet $lst {1 2 3 4 5 6} "-all"
  540.  
  541.     Display 0 "VtDrawnListGetItem test DONE"
  542. }
  543.  
  544. #
  545. # This tests the VtDrawnListDeleteItems call.
  546. # It excercises the following options
  547. #        -position
  548. #    -positionList
  549. #    -field
  550. #    -all
  551. #
  552. # it relies on a procedure which generates the display
  553. # and delete commands doDelete.  Which in turn relies 
  554. # on VtDrawnListGetItems VtDrawnListAddItems.
  555. #
  556. proc doDelete {lst posList args} {
  557.  
  558.          restoreList $lst
  559.  
  560.     set args [join $args]
  561.          Display 1 "Delete Test \n   $args"
  562.     eval "VtDrawnListDeleteItem $lst $args"
  563.     set recordList [VtDrawnListGetItem $lst -all]
  564.     checkRecords $recordList $posList $args
  565.     Display 1 "Delete Test \n   Passed $args"
  566. }
  567.  
  568. proc testDelCB {lst cbs} {
  569.  
  570.     # check that -position works
  571.     doDelete $lst {1 2 4 5 6} "-position 3"
  572.     
  573.     doDelete $lst {2 4 5 6} "-positionList {1 3}"
  574.  
  575.     doDelete $lst {1 3 4 5 6} "-field 3 {String two}"
  576.  
  577.     doDelete $lst {} "-all" 
  578.  
  579.     # Test some error conditions
  580.     doTestError VtDrawnListDeleteItem $lst "-position 9"
  581.     doTestError VtDrawnListDeleteItem $lst "-field 3 {shark}"
  582.  
  583.     Display 0 "DONE testing VtDrawnListDeleteItem"
  584. }
  585.  
  586. proc testAllCB {lst cbs} {
  587.      testGetCB $lst $cbs
  588.      testDelCB $lst $cbs
  589.      testSetCB $lst $cbs
  590.      testSelectCB $lst $cbs
  591.      testDeselectCB $lst $cbs
  592.  
  593.      Display 0 "Done Testing everything"
  594. }
  595.  
  596. proc dontCloseCB {cbs} {
  597.     set target [keylget cbs dialog]
  598.     
  599.     set mb [VtMessageDialog $target.err -message "You can't do that :) " -ok]
  600.     VtShow $mb
  601. }
  602.  
  603. #
  604. # ----------------------------------------------------------------
  605. # main
  606. #
  607. set ap [VtOpen dd]
  608.  
  609. set fn [VtFormDialog $ap.form \
  610.     -wmDecoration ALL -MOTIF_marginWidth 5 -MOTIF_marginHeight 5 \
  611.     -wmCloseCallback dontCloseCB ]
  612.  
  613. set displayTxt [VtText $fn.txt \
  614.     -rows  4\
  615.     -wordWrap \
  616.     -topSide FORM -leftSide FORM -rightSide FORM -MOTIF_rightOffset 25 ]
  617.  
  618. #
  619. # This sets the global display area for the tools.tcl routines
  620. #
  621. InitDisplay $displayTxt
  622.  
  623. set dl [VtDrawnList $fn.dl \
  624.         -iconList {./dir.px exec.px file.px} \
  625.     -CHARM_iconList {a b c} \
  626.     -formatList { \
  627.         {ICON 1} \
  628.         {ICON 1} \
  629.         {ICON 1} \
  630.         {STRING 25 5} \
  631.         {STRING 30 5} \
  632.         {DATA } } \
  633.     -CHARM_formatList { \
  634.         {ICON 1} \
  635.         {ICON 1} \
  636.         {ICON 1} \
  637.         {STRING 25 2} \
  638.         {STRING 30 2} \
  639.         {DATA } } \
  640.     -leftSide FORM -rightSide FORM -topSide $DisplayTxt  \
  641.     -labelFormatList { {ICON 3 5} {STRING 25 5} {STRING 30 5}} \
  642.     -labelList {Icons "Label Above Columns" "Object"} \
  643.     -columns 30 \
  644.     -rows 6\
  645.     -selection MULTIPLE \
  646.     -callback recordSelectCB -defaultCallback doubleCB]
  647.  
  648. restoreList $dl
  649.  
  650. set rc [VtRowColumn $fn.rc -horizontal -packing COLUMN -numColumns 3 \
  651.         -topSide NONE -leftSide FORM -bottomSide FORM ]
  652.  
  653. VtSetValues $dl -bottomSide $rc
  654.             
  655. MakeCenteredButton $rc.tstAll   "Test All"      "testAllCB $dl"
  656. MakeCenteredButton $rc.tstGet   "Test Get"      "testGetCB $dl"
  657. MakeCenteredButton $rc.tstDel   "Test Delete"   "testDelCB $dl"
  658. MakeCenteredButton $rc.tstSet   "Test Set"      "testSetCB $dl"
  659. MakeCenteredButton $rc.tstSel   "Test Select"   "testSelectCB $dl"
  660. MakeCenteredButton $rc.tstGSel  "Test Get Select"   "testGetSelectCB $dl"
  661. MakeCenteredButton $rc.tstDsel  "Test Deselect" "testDeselectCB $dl"
  662. MakeCenteredButton $rc.tstTopItem "Test TopItem"    "testTopItemCB $dl"
  663. MakeCenteredButton $rc.tstAdd   "Test Add"    "testAddCB $dl"
  664. MakeCenteredButton $rc.quit    "Exit"         QuitCB  
  665.  
  666. VtSetValues $dl -bottomSide $rc
  667.  
  668. VtShowDialog $fn
  669.  
  670. VtMainLoop
  671.